//app.js
App({
  onLaunch: function () {
    var that=this;
    wx.login({
      success: function (data) {

        //获取openid;
        if (wx.getStorageSync('oid') && wx.getStorageSync('oid')!=""){
          return;
        }
        wx.request({
          url: 'https://www.dzbjapp.com/api/getopenid',
          data:{
            code:data.code
          },
          success:function(data){
            console.log(JSON.stringify(data))
            //缓存openid
            wx.setStorageSync('oid', data.data.data.openid)
          }
        })
      }
    })
  },
  globalData:{
    addFrom:'',
    addTo:'',
    dis:'',
    carType:'',
    carInfo:'',
    carPrice:'',
    totalPrice:'',
    fromIndex:null
  }
})

